package engine.control
{
	import engine.logic.McPool;
	
	import flash.display.MovieClip;
	
	import newx.StageInfo;
	import newx.com.ResManager;

	public class NewGolw
	{
		private var _vectArr:Vector.<GolwState>=new Vector.<GolwState>();
		private var _TxMc:MovieClip;
		private var _traget:Object;
		public function NewGolw()
		{
		}
		public function StarPlay(obj:Object) :void
		{
			_TxMc=getMC(obj);
			if(_TxMc!=null)
			{
				_TxMc.play();
			}
		}
		public function StopPlay(obj:Object):void
		{
			_TxMc=getMC(obj);
			if(_TxMc!=null)
			{
				_TxMc.stop();
				_TxMc=null;
			}
			
			for(var i:String in _vectArr)
			{
				if(_vectArr[i].obj == obj)
				{
					 _vectArr.splice(int(i),1);
				}
			}
		}
		private function getMC(obj:Object):MovieClip
		{
			for(var i:String in _vectArr)
			{
				if(_vectArr[i].obj == obj)
				{
					return (_vectArr[i]).mc;
				}
			}
			return null;
		}
		public function setMc(obj:Object):void
		{
			_traget=obj;
			if(getMC(obj)==null)
			{
				_TxMc=ResManager.newResClass("CustomControl_0112") as MovieClip;
				_TxMc.x=obj.x;
				_TxMc.y=obj.y;
				_vectArr.push(new GolwState(obj,_TxMc));
			}
		}
	}
}
import flash.display.MovieClip;

class GolwState
{
	public var obj:Object;
	public var isGolw:Boolean;
	public var mc:MovieClip;
	public function GolwState(obj:Object,mc:MovieClip)
	{
		this.obj=obj;
		this.mc=mc;
	}
}